﻿using System;
using Me.Amon.POS.C;

namespace Me.Amon.POS.M
{
    public class MVip : MPos
    {
        public string corp_id;

        public int is_vip;

        /// <summary>
        /// 姓
        /// </summary>
        public string last_name;
        /// <summary>
        /// 中间名
        /// </summary>
        public string middle_name;
        /// <summary>
        /// 名
        /// </summary>
        public string first_name;
        /// <summary>
        /// 显示名称
        /// </summary>
        public string display_name;

        /// <summary>
        /// 性别
        /// </summary>
        public int sex;

        public int level;

        public string level_name;

        public DateTime level_time;

        public int point;

        public string birthday;

        public MVip()
        {
        }

        public bool IsVip()
        {
            return level > 0;
        }

        public bool IsBirthday()
        {
            return DateTime.Now.ToString("yyyy/m/d") == birthday;
        }

        public override string ToString()
        {
            return display_name;
        }

        public static string GetSex(object sex)
        {
            if (sex is int)
            {
                switch ((int)sex)
                {
                    case CVip.SEX_MALE:
                        return "先生";
                    case CVip.SEX_FEMALE:
                        return "女士";
                    default:
                        return "未知";
                }
            }
            return "-";
        }
    }
}
